<template>
  <div class="header">
    <div class="left-panel">
      <UploadFilled class="logo" />
      <div class="title">Star云盘</div>
    </div>

    <div class="right-panel">
      <sort class="transfer"></sort>
      <el-dropdown>
        <div class="user-info">
          <div class="avatar">
            <el-avatar class="avatar" :size="46" :src="circleUrl" />
          </div>

          <span class="nickname">{{ user.name }}</span>
        </div>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>修改头像</el-dropdown-item>
            <el-dropdown-item>修改密码</el-dropdown-item>
            <el-dropdown-item>退出</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script setup lang="ts">
import { UploadFilled, Sort } from "@element-plus/icons-vue";
import { ref } from "vue";

const circleUrl = ref(
  "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
);
const user = ref({
  name: "admin",
});
</script>

<style lang="scss" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  box-shadow: 0 3px 10px 0 rgb(0 0 0 / 6%);
  padding: 0 24px;
  position: relative;

  .left-panel {
    display: flex;
    align-items: center;

    .logo {
      width: 40px;
      height: 40px;
      color: #05a1f5;
    }

    .title {
      font-weight: 700;
      margin-left: 5px;
      font-size: 25px;
      color: #05a1f5;
    }
  }

  .right-panel {
    display: flex;
    align-items: center;

    .transfer {
      width: 16px;
      height: 16px;
    }

    .user-info {
      display: flex;
      align-items: center;
      margin-right: 10px;

      .avatar {
        margin: 0 5px 0 15px;
      }

      .nickname {
        color: #05a1f5;
      }
    }
  }
}
</style>
